package jiyun.com.yiyanmeng;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;

public class MeHeadActivity extends AppCompatActivity implements View.OnClickListener {

    private int PHOTO_REQUEST_GALLERY = 1;

    private ImageView mHeadImage;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_me_head);
        initView();
    }

    private void initView() {
        mHeadImage = (ImageView) findViewById(R.id.head_image);
        mHeadImage.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            default:
                break;
            case R.id.head_image:
                head_image();
                break;
        }
    }

    public void head_image(){
        //打开相册
        Intent intent = new Intent(Intent.ACTION_PICK);
        intent.setType("image/*");
        startActivityForResult(intent, PHOTO_REQUEST_GALLERY);
        //
    }
}
